package com.xiaoxi.compositemode.composite;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.compositemode.composite
 * @ClassName AbstractEntry
 * @Description TODO
 * @Date 2023/3/14 16:30
 * @Version 1.0
 */
public abstract class AbstractEntry extends Entry {

    @Override
    public String pwd() {
        StringBuffer sb = new StringBuffer();
        Entry entry = this;
        do {
            sb.insert(0, "/" + entry.getName());
            entry = entry.parent;
        } while (entry != null);
        return sb.toString();
    }
}
